package com.zdw.oauth.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zdw.oauth.entity.PermissionEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 权限 Mapper 接口
 * </p>
 *
 * @author 卓德文
 * @since 2023-07-17
 */
public interface PermissionMapper extends BaseMapper<PermissionEntity> {

    /**
     * 查询权限树
     * @return
     */
    List<PermissionEntity> tree();


    /**
     * 根据父权限ID查询子权限列表
     * @return
     */
    List<PermissionEntity> selectSonListByParentId(@Param("id") Integer id);

    /**
     * 根据ID集合查询子权限列表
     * @return
     */
    List<PermissionEntity> selectSonListByIdList(@Param("list") List<Integer> list);

}
